package com.lh.web.service.impl.notice;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.github.pagehelper.PageHelper;
import com.lh.common.entity.admin.Notice;
import com.lh.common.utils.PageUtils;
import com.lh.web.dao.NoticeMapper;
import com.lh.web.service.serviceAdmin.notice.NoticeService;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;

/**
 * @author FH
 * @ClassName: NoticeServiceImpl
 * @Description: (类作用)
 * @date: 2020-05-08 13:51
 */
@Service
public class NoticeServiceImpl extends ServiceImpl<NoticeMapper, Notice> implements NoticeService {

    @Override
    public PageUtils queryNoticeList(Map<String, Object> param, Integer pageNum, Integer pageSize) {
        PageHelper.startPage(pageNum, pageSize);
        List<Notice> notices = this.baseMapper.queryNoticeList(param);
        return new PageUtils(notices);
    }

    @Override
    public int insertNotice(Notice notice) {
        return this.baseMapper.insertNotice(notice);
    }

    @Override
    public int updateNotice(Notice notice) {
        return this.baseMapper.updateNotice(notice);
    }

    @Override
    public int updateNoticeStatus(Map<String, Object> params) {
        return this.baseMapper.updateNoticeStatus(params);
    }

    @Override
    public int deleteNotice(Long[] nid) {
        return this.baseMapper.deleteNotice(nid);
    }
}
